package com.jiepos.mpos.core.entity;

import java.io.Serializable;
import java.util.List;

/**
 * 
* 描述: 用于前台列表页的显示分页
* 模块: 通用平台
* @author  娄伟峰
* @version 1.0
 */
public class Pagination implements Serializable {
	
	private static final long serialVersionUID = 475323711973090750L;

	/** 当前是第几页 */
	public int page = 1;
	
	/** 一共有多少页 */
	public int maxPage;
	
	/** 一共有多少行*/
	public long maxRowCount;
	
	/** 每页多少行 */
	public int rows=10;
	
	/** 查询字符串（保留） */
	public String queryString;
	
	/** 模糊查询关键字 */
	public String queryKeyWord;
	
	/** 本页要显示的数据 */
	@SuppressWarnings("unchecked")
	private List data;
	/**
	 * 原始的list集合
	 */
	private List oldData;
	
	/**
	 * 排序时是顺序还是降序 desc asc
	 */
	private String order;
	/**
	 * 排序字段
	 */
	private String sort;
	/**
	 * 根据总行数计算总页数
	 */
	public void countMaxPage() {
		this.maxPage = (int) ((this.maxRowCount-1) / this.rows) + 1;
	}

	public List getData() {
		return data;
	}

	public void setData(List data) {
		this.data = data;
		this.countMaxPage();
	}

	/**
	 * @return the queryString
	 */
	public String getQueryString() {
		return queryString;
	}

	/**
	 * @param queryString the queryString to set
	 */
	public void setQueryString(String queryString) {
		this.queryString = queryString;
	}

	 
	/**
	 * @return the maxPage
	 */
	public int getMaxPage() {
		return maxPage;
	}

	/**
	 * @param maxPage the maxPage to set
	 */
	public void setMaxPage(int maxPage) {
		this.maxPage = maxPage;
	}

	/**
	 * @return the maxRowCount
	 */
	public long getMaxRowCount() {
		return maxRowCount;
	}

	/**
	 * @param maxRowCount the maxRowCount to set
	 */
	public void setMaxRowCount(long maxRowCount) {
		this.maxRowCount = maxRowCount;
	}
 

 

	/**
	 * @return the queryKeyWord
	 */
	public String getQueryKeyWord() {
		return queryKeyWord;
	}

	/**
	 * @param queryKeyWord the queryKeyWord to set
	 */
	public void setQueryKeyWord(String queryKeyWord) {
		this.queryKeyWord = queryKeyWord;
	}

	public String getOrder() {
		return order;
	}

	public void setOrder(String order) {
		this.order = order;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public List getOldData() {
		return oldData;
	}

	public void setOldData(List oldData) {
		this.oldData = oldData;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}
}
